Release 10.1A: OpenEdge Data Management:
SQL Reference
Bit string data types
Bit string data types are used to define bit strings, which are sequences of bits having the value of either 0 or 1. This is the syntax for a bit string data type:
BITCorresponds to a single bit value of 0 or 1.
SQL statements can assign and compare values in
BITcolumns to and from columns of typesCHAR,VARCHAR,BINARY,VARBINARY,TINYINT,SMALLINT,and INTEGER.However, in assignments fromBINARYandVARBINARY, the value of the first four bits must be0001or0000.No arithmetic operations are allowed on
BITcolumns.BINARY [ ( length ) ]Corresponds to a bit field of the specified length of bytes. The default length is 1 byte. The maximum length is 2000 bytes.
When inserting literals into binary data types,
INSERTstatements must use a special format to store values inBINARYcolumns. They can specify the binary values as a bit string, hexadecimal string, or character string.INSERTstatements must enclose binary values in single-quote marks, preceded bybfor a bit string andxfor a hexadecimal string. Table 48 lists the specification formats for binary values.
Table 48: Specification formats for binary values Specification Format Example Bit stringb''b'1010110100010000' Hexadecimal stringx''x'ad10' Character string '' 'ad10'SQL interprets a character string as the character representation of a hexadecimal string.
If the data inserted into a
BINARYcolumn is less than the length specified, SQL pads it with zeros.
BINARYdata can be assigned and compared to and from columns of typeBIT,CHAR, andVARBINARY. Arithmetic operations are not allowed.VARBINARY ( length )Corresponds to a variable-length bit field of the specified length in bytes. The default length is 1 byte. The maximum length is 31,995 bytes. The default length is 1.
Note: Due to index limitations, only the narrowerVARBINARYcolumns can be indexed.LVARBINARY ( length )Corresponds to an arbitrarily long byte array with the maximum length defined by the amount of available disk storage up to 1,073,741,823. A
BLOBis an object of data typeLVARBINARY.Maximum length for VARBINARY
The maximum length of the
VARBINARYdata type depends on:LVARBINARY limitations
Current limitations for
LVARBINARYsupport are listed below:
LVARBINARYdata type will only be accessible from the SQL Engine.LVARBINARYdata columns added to tables created by the Progress 4GL are not visible to the 4GL.LVARBINARYdata columns cannot be part of an index.LVARBINARYdata columns cannot be used for variables or as parameters in stored procedures.- Comparison operations are not supported on
LVARBINARYcolumns. Comparison operations betweenLVARBINARYcolumns are not supported. Comparison operations betweenLVARBINARYcolumns and columns of other data types are not supported.- Conversion, aggregate, and scalar functions are disallowed on this data type.
LVARBINARYdoes not have National Language Support (NLS).Language support for LVARBINARY
This data type has normal column functionality except for the following exceptions:
- A column of data type
LVARBINARYis not a valid column name in aCREATE INDEXstatement.Note: When creating a table with a column of data type- When issuing a
CREATE TABLEstatement, a valid data type for the column definitions isLVARBINARY. However,LVARBINARYdoes not allow the column constraints ofPRIMARY KEY,FOREIGN KEY,UNIQUE,REFERENCES, andCHECK.LVARBINARY, place the table in a newAREA.- The
VALUESoption on theINSERTstatement is not valid for theLVARBINARYdata type.- In a
SELECTstatement, aWHERE,GROUP BY,HAVING, orORDER BYclause cannot use a column of data typeLVARBINARY.- There is no support for an
UPDATEof anLVARBINARYcolumn on a table that contains a column of data typeLVARBINARY. Obtain the functionality of anUPDATEon anLVARBINARYcolumn by using theDELETEandINSERTstatements for the record.Utility support for LVARBINARY
Use
Note:BINARY DUMP/LOADto dump and load data that contains theLVARBINARYdata type.SQLDUMPandSQLLOADdo not support tables withLVARBINARYcolumn data.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |